package com.tool.cn.util;

import javax.swing.JOptionPane;
import javax.swing.UIManager;

/**
 * 
 * @author wangzonghui
 * @date 2020-12-8 17:12:58 
 * @Description 桌面弹窗提醒工具类
 * 资料：https://blog.csdn.net/c1481118216/article/details/51921521
 */
public final class RemindUtil {
	
	static{
		try {
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	/**
	 * 消息提醒
	 * @param context 提醒内容
	 */
	public static void infoMsg(String context) {
		JOptionPane.showMessageDialog(null, context );
	}

	/**
	 * 消息提醒
	 * @param context
	 */
	public static void infoMsg(String title,String context) {
		JOptionPane.showMessageDialog(null, context, title, JOptionPane.PLAIN_MESSAGE);
	}
	
	/**
	 * 警告提醒
	 * @param context
	 */
	public static void warmMsg(String title,String context) {
		JOptionPane.showMessageDialog(null, context,title, JOptionPane.WARNING_MESSAGE);
	}
	
	/**
	 * 错误提示
	 */
	public static void errorMsg(String title,String context) {
		JOptionPane.showMessageDialog(null,context, title, JOptionPane.ERROR_MESSAGE);
	}
}
